﻿using ConfExpert.Forms.Base;
using DevTeam;
using System;
using System.Windows.Forms;

namespace ConfExpert.Forms.Depo
{
    public partial class KumasCikisRaporu : XForm
    {
        public KumasCikisRaporu()
        {
            InitializeComponent();
        }

        private void KumasCikisRaporu_Load(object sender, EventArgs e)
        {

            this.Text = "Kumaş Çıkış Raporu";
            deBaslangic.EditValue = DateTime.Now.AddMonths(-1);
            deBitis.EditValue = DateTime.Now;

            BindingSource bs = new BindingSource(ds, "xKumasCikisRaporu");
            InitGridView(gv, bs);
            gv.Columns["Product"].Visible = false;
            gv.Columns["Scan"].VisibleIndex = 1;
            gv.YanYanaGetirSagina("Scan", "ProductId", "TopAdedi", "Metraj");

            btnGuncelle.ItemClick += btnGuncelle_ItemClick;
            btnGuncelle.PerformClick();
        }

        void btnGuncelle_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gv.EndEditing();
            ds.xKumasCikisRaporu.Clear();
            GetDetails("xKumasCikisRaporu", "GetKumasKesimRaporu", deBaslangic.EditValue, deBitis.EditValue);
            gv.BestFitColumns();
            //chart.Series[0].TopNOptions.Count = Convert.ToInt32(spinCount.EditValue);
            chart.Refresh();
        }

    }
}